import React from 'react'
import Menu from '@/views/Menu'
import '@/assets/css/BusinessIndex.scoped.css'

const Component = () =>
{
  //退出登录
  const logout = async () =>
  {
    //弹出提示框
    var result = await React.UI.Dialog.confirm({
      content: '是否确认退出'
    })
    
    //点击了确认
    if(result) React.navigate('/business/login')
  }

  return (
    <>
      <div className="header">
          <div className="userinfo">
              <div className="avatar">
                  <img src={require('@/assets/images/avatar.png')} />
              </div>
              <div className="nickname">React</div>
          </div>
          <div className="corrugated">
              <div className="wave-top wave-item"></div>
              <div className="wave-middle wave-item"></div>
              <div className="wave-bottom wave-item"></div>
          </div>
      </div>
      
      <div className="menu-cell">
          <div className="item">
              <Link to={'/business/profile'}>
                  <div className="title">个人资料</div>
                  <div className="icon">
                      <img src={require("@/assets/images/right.png")} />
                  </div>
              </Link>
          </div>

          <div className="item">
              <Link to={"/business/email"}>
                  <div className="title">邮箱验证</div>
                  <div className="icon">
                      <img src={require("@/assets/images/right.png")} />
                  </div>
              </Link>
          </div>
          
          <div className="item">
              <Link to={"/order"}>
                  <div className="title">我的订单</div>
                  <div className="icon">
                      <img src={require("@/assets/images/right.png")} />
                  </div>
              </Link>
          </div>

          <div className="item">
              <Link to={'/coupon'}>
                  <div className="title">我的优惠券</div>
                  <div className="icon">
                      <img src={require("@/assets/images/right.png")} />
                  </div>
              </Link>
          </div>
          
          <div className="item" onClick={logout}>
              <a>
                  <div className="title">退出登陆</div>
                  <div className="icon">
                      <img src={require("@/assets/images/right.png")} />
                  </div>
              </a>
          </div>
      </div>

      <Menu />
    </>
  )
}

export default Component